﻿using Basic.FormRemoteModel.FormViewCol;
using Basic.FormRemoteModel.FormViewCol.Model;
using Basic.FormService.Interface;
using WeDonekRpc.Client.Interface;

namespace Basic.FormService.RpcEvent
{
    internal class FormViewColEvent : IRpcApiService
    {
        private readonly IFormViewColService _Service;

        public FormViewColEvent ( IFormViewColService viewCol )
        {
            this._Service = viewCol;
        }

        public void DeleteFormViewCol ( DeleteFormViewCol obj )
        {
            this._Service.Delete(obj.Id);
        }
        public ViewCol[] SyncFormViewCol ( SyncFormViewCol obj )
        {
            return this._Service.Sync(obj.Datum);
        }
        public long AddFormViewCol ( AddFormViewCol obj )
        {
            return this._Service.Add(obj.Datum);
        }
        public bool SetFormViewCol ( SetFormViewCol obj )
        {
            return this._Service.Set(obj.Id, obj.Datum);
        }

        public ViewCol[] GetFormViewCols ( GetFormViewCols obj )
        {
            return this._Service.Gets(obj.FormId);
        }

        public ViewBody GetFormViewBody ( GetFormViewBody obj )
        {
            return this._Service.GetBody(obj.FormId);
        }
    }
}
